package com.mine.jzh3.oss.entity;

import lombok.Data;
import org.springframework.util.StringUtils;

/**
 * 阿里云OSS配置
 */
@Data
public class AliOSSConfig {
    private String endpoint;
    private String accessKey;
    private String secretKey;
    private String bucketName;
    private String domain;

    /**
     * 获取配置ID
     */
    public String getConfigId() {
        return endpoint + ":" + accessKey + ":" + bucketName;
    }

    /**
     * 配置是否有效
     */
    public boolean isValid() {
        return StringUtils.hasText(endpoint) && StringUtils.hasText(accessKey) && StringUtils.hasText(secretKey) && StringUtils.hasText(bucketName);
    }
}
